
# 按字符数量来读取
# f = open('d:/My Computer/text.txt','r',encoding='utf8')
# result = f.read(5)
# print(result)
# f.close()


# 按行读取
# f = open('d:/My Computer/text.txt','r',encoding='utf8')
# for line in f:
#     print(f'line = {line}', end = '')
# f.close()


# 直接读完所有内容，并且按行进行组织
f = open('d:/My Computer/text.txt', 'r', encoding='utf8')
lines = f.readlines()
print(lines)
f.close()